package com.hillky.springboot.mapper;

import com.hillky.springboot.controller.request.BaseRequest;
import com.hillky.springboot.entity.Borrow;
import com.hillky.springboot.entity.Retur;
import com.hillky.springboot.mapper.po.BorrowReturCountPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BorrowMapper {

    List<Borrow> list();

    List<Borrow> listByCondition(BaseRequest baseRequest);

    void save(Borrow user);

    List<Retur> returListByCondition(BaseRequest baseRequest);

    void saveRetur(Retur retur);

    Borrow getById(Integer id);

    void update(Borrow user);

    void deleteById(Integer id);

    void deleteReturById(Integer id);

    void updateStatus(String status, Integer id);

    List<BorrowReturCountPO> getCountByTimeRange(@Param("timeRange") String timeRange,@Param("type") int type);
}
